package errmsg

const (
	SUCCESS = 200

	ERROR              = 400
	ERROR_NO_PRIVILEGE = 401

	ERROR_FORMAT_ERROR = 701

	ERROR_PASSWORD_ERROR = 1001
	ERROR_PHONE_EXIST    = 1002
	ERROR_PHONE_NOTEXIST = 1003
	ERROR_USER_NOTEXIST  = 1004
)

var codeMsg = map[int]string{
	SUCCESS: "OK",
	ERROR:   "FAIL",

	ERROR_NO_PRIVILEGE: "权限不足",

	ERROR_FORMAT_ERROR: "数据格式不匹配",

	ERROR_PASSWORD_ERROR: "密码错误",
	ERROR_PHONE_EXIST:    "该手机号已被注册",
	ERROR_PHONE_NOTEXIST: "手机号未注册",
	ERROR_USER_NOTEXIST:  "用户不存在",
}

func GetErrorMsg(code int) string {
	return codeMsg[code]
}
